package pl.edu.pw.perg.compinfodb.xls.from;

import pl.edu.pw.perg.compinfodb.xls.XLSUtils;


@SuppressWarnings("serial")
public class InvalidMetadataFormatException extends RuntimeException {

	private XLSMetadataReader.XLSSheets sheet;
	
	public InvalidMetadataFormatException(String message, XLSMetadataReader.XLSSheets sheetName, String col, int row){
		super("[Sheet] " + sheetName.getName() +" [Column] " +
				col + " [Row] " + (row + 1) +" [MSG]" + message );
		sheet = sheetName;
	}
	
	public InvalidMetadataFormatException(String message, XLSMetadataReader.XLSSheets sheetName, int col, int row){
		super("[Sheet] " + sheetName.getName() +" [Column] " +
				XLSUtils.columnInt2String(col) + " [Row] " + (row + 1) +" [MSG]" + message );
		sheet = sheetName;
	}
	
	public InvalidMetadataFormatException(String message, XLSMetadataReader.XLSSheets sheetName){
		super("[Sheet] " + sheetName.getName() + " [MSG] " + message);
		sheet = sheetName;
	}
	
	public InvalidMetadataFormatException(String message, XLSMetadataReader.XLSSheets sheetName, String col,
			int row, Throwable cause){
		super("[Sheet] " + sheetName.getName() + " [Column] " +	col + " [Row] " + 
				(row + 1) +" [MSG] " + message, cause);
		sheet = sheetName;
	}
	public InvalidMetadataFormatException(String message, XLSMetadataReader.XLSSheets sheetName, int col,
			int row, Throwable cause){
		new InvalidMetadataFormatException(message, sheetName, XLSUtils.columnInt2String(col), row);
	
	}

	public XLSMetadataReader.XLSSheets getSheet() {
		return sheet;
	}
}
